package q2154_findFinalValue;

public class Solution {
    /*
    hash表的经典题
     */
    public int findFinalValue(int[] nums, int original) {
        int[] hash = new int[1001];
        for (int i = 0; i < nums.length; ++i) {
            hash[nums[i]] = 1;
        }
        while (original <= 1000 && hash[original] == 1) {
            original *= 2;
        }
        return original;
    }
}
